#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

#define x first
#define y second
using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
const int N = 40;

string str;
char ans[N][N];
int main()
{
	cin.tie(0);
	cin >> str;
	int len = str.size();
	int n1, n2, n3;
	n1 = (len + 2) / 3;
	n3 = n1;
	n2 = len + 2 - n1 - n3;
	memset(ans, ' ', sizeof(ans));
	int pos = 0;
	for(int i = 1; i <= n1; i ++) {
		ans[i][1] = str[pos++];
	}
	for(int i = 2; i <= n2; i ++)
	{
		ans[n1][i] = str[pos ++];
	}
	for(int i = n3 - 1; i >= 1; i --) {
		ans[i][n2] = str[pos ++];
	}
	
	for(int i = 1; i <= n1; i ++)
	{
		for(int j = 1; j <= n2; j ++)
		{
			printf("%c", ans[i][j]);
		}
		puts("");
	}

	return 0;
}